package com.atguigu.springcloud.service;

import com.atguigu.springcloud.entities.CommonResult;
import com.atguigu.springcloud.entities.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/*
声明式编程,让程序变得优雅
* OpenFeign的接口类
*获取该CLOUD-PAYMENT-SERVICE服务下的
*声明的接口
* */
@Component/*方便其它类注入*/
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")
public interface OrderFeignService {

    @GetMapping("/payment/get/{id}")
    public CommonResult<Payment> get(@PathVariable("id") int id);

    @GetMapping(value = "/payment/getTimeOut")
    public String getTimeOut();
}
